<template>
	<view class="box">
<!-- 		<view id="hbh">
			
		</view> -->
		<view class="btnBox">
			开始推流
		</view>
	</view>
</template>


<script>
	export default {
		data() {
			return {
				show: false,
				currentWebview: null,
				pusher:null
			}
		},
		onLoad() {
			// 注意：需要在onReady中 或 onLoad 延时
			this.$nextTick(() => {
				this.currentWebview = this.$mp.page.$getAppWebview()
				this.pusher = plus.video.createLivePusher("livepusher", {
					url: 'rtmp://192.168.1.18:1935/prePublish/diao',
					top: '0px',
					left: '0px',
					width: '100%',
					height: '300px',
					position: 'static'
				});
				this.currentWebview.append(this.pusher);
			})

		},

		methods: {
			//开始推流
			satrt(){
				this.pusher.start();
			}
		}
	}
</script>

<style lang="less" scoped>
	.box {
		height: 100vh;
		#hbh{
			width: 100vw;
			height: 400rpx;
		}

	}

	.btnBox {
		position: fixed;
		bottom: 0rpx;
		left: 0rpx;
		width: 100%;
		height: 100rpx;
		line-height: 100rpx;
		text-align: center;
		background-color: pink;
	}
</style>